home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
ASTRONOM
/
H139.ZIP
/
UI101.ZIP
/
IO
/
UI
/
UI.DOC
< prev
next >
Wrap
Text File
|
1991-11-04
|
45KB
|
1,452 lines
The BYWATER Graphical USER INTERFACE
Copyright (c) 1991, Ted A. Campbell
Bywater Software
P. O. Box 4023
Duke Station
Durham, NC 27706
email: tcamp@uncecs.edu
Copyright and Permissions Information:
All U.S. and international copyrights are claimed by the
author. The author grants permission to use this code
and software based on it under the following conditions:
(a) in general, the code and software based upon it may be
used by individuals and by non-profit organizations; (b) it
may also be utilized by governmental agencies in any country,
with the exception of military agencies; (c) the code and/or
software based upon it may not be sold for a profit without
an explicit and specific permission from the author, except
that a minimal fee may be charged for media on which it is
copied, and for copying and handling; (d) the code must be
distributed in the form in which it has been released by the
author; and (e) the code and software based upon it may not
be used for illegal activities.
The Bywater Graphical User Interface offers a user interface
employing various types of graphical windows, keyboard, mouse,
and icons. It serves as the basis for the Bywater Space Flight
Simulator and for other projects underway at Bywater. The
system is currently implemented on the IBM PC and compatibles
utilizing the Microsoft QuickC compiler, on the AT&T Unix PC
(PC 7300), and on DecStation Unix Workstations utilizing the
X Windows system.
The system builds on five components:
bw the error handling system
gr the graphics and mouse system
kb the keyboard system
dr the directory system
tw the text window system,
and from these is built
ui the graphical user interface itself.
REFERENCE FOR GR (GRAPHICS) SYSTEM:
----------------------------------
/****************************************************************
colors
****************************************************************/
#define BLACK 0
#define WHITE 1
#define LIGHT_RED 2
#define LIGHT_GREEN 3
#define LIGHT_BLUE 4
#define LIGHT_YELLOW 5
#define LIGHT_CYAN 6
#define LIGHT_MAGENTA 7
#define DARK_RED 10
#define DARK_GREEN 11
#define DARK_BLUE 12
#define DARK_YELLOW 13
#define DARK_CYAN 14
#define DARK_MAGENTA 15
/****************************************************************
fill (and line) styles
****************************************************************/
#define HOLLOW 0 /* Hollow fill -- draw perimeter */
#define SOLID 1
#define GRID 2
#define HATCH 3
/****************************************************************
input modes
****************************************************************/
#define STATUS 0
#define WAIT 1
#define SAMPLE 2
#define HIDE 3
#define SHOW 4
#define POSITION 5
/****************************************************************
screens
****************************************************************/
#define GR_PRIMARY 0 /* primary drawing screen */
#define GR_HIDDEN 1 /* secondary or hidden drawing screen */
/****************************************************************
fonts
****************************************************************/
#define F_DEFAULT 0
#define F_ROMAN 1
#define F_GOTHIC 2
#define F_ITALIC 3
/****************************************************************
gr_window structure
****************************************************************/
struct gr_window
{
int initialized; /* Boolean: successfully initialized? */
int xmax; /* Maximum number of pixels, x axis */
int ymax; /* Maximum number of pixels, y axis */
int font; /* Current font style */
int fxsize; /* Font size in pixels, x axis */
int fysize; /* Font size in pixels, y axis */
int clipping; /* Boolean: is cliiping in use? */
int cl_x1; /* Left of clip window */
int cl_y1; /* Bottom of clip window */
int cl_x2; /* Right of clip window */
int cl_y2; /* Top of clip window */
};
COORDINATE SYSTEM. The gr interface presupposes throughout
a Cartesian coordinate system in which pixels on the vertical
axis (the y axis) are numbered beginning with 0 from the
bottom up, and pixels on the horizontal axis (the x axis)
are numbered beginning with 0 from the ;eft to the right.
The numbering of the y axis may seem counterintuitive,
since in many systems pixels are numbered vertically from
the top to the bottom.
/****************************************************************
gr_init()
This function should initialize the entire graphics and mouse
subsystem. The argument "grwindow" is a pointer to a gr_window
structure which should be filled in by the function. The
argument "font_path" is a pointer to a character string
giving the name of a path where the function should look
for font and other data files. The function should return
BW_ERROR upon any error and TRUE upon a successful setting
of the graphics subsystem.
****************************************************************/
gr_init( grwindow, font_path )
struct gr_window *grwindow;
char * font_path;
/****************************************************************
gr_deinit()
This function should deinitialize the entire graphics subsystem.
****************************************************************/
gr_deinit()
/****************************************************************
gr_cls()
This function should clear the entire screen area.
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
****************************************************************/
gr_cls( screen )
int screen;
/****************************************************************
gr_pixel()
This function turns on (or off, if the color is BLACK) a single
pixel on the display.
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
The arguments x and y specify a pixel location on the screen
in gr coordinates (see above on the coordinate system) where
the pixel is to be located, x on the horizontal axis and y
on the vertical axis.
The argument "color" is an integer denoting a color defined
in the header "gr.h".
****************************************************************/
gr_pixel( screen, x, y, color )
int screen;
int x, y;
int color;
/****************************************************************
gr_line()
This function draws a line on the designated screen from
point x1, y1 to point x2, y2 in a specified color and
with a specified style.
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
The arguments x1, y1, x2, and y2 specify two pixel locations
on the screen in gr coordinates (see above on the coordinate
system) denoting the source (x1, y1) and destination (x2, y2)
points for the line (x1 and x2 on the horizontal axis, and y1
and y2 on the vertical axis.
The argument "color" is an integer denoting a color defined
in the header "gr.h".
The argument "style" is an integer denoting a line style
defined in "gr.h" (HOLLOW, SOLID, GRID, or HATCH -- GRID
and HATCH denote dotted lines, and HOLLOW erases the area
of the line).
****************************************************************/
gr_line( screen, x1, y1, x2, y2, color, style )
int screen;
int x1, y1, x2, y2;
int color, style;
/****************************************************************
gr_text()
This function addresses text to a specified location on the
screen in specified colors.
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
The arguments x and y specify a pixel location on the screen
in gr coordinates (see above on the coordinate system) where
the bottom left corner of the text is to be located, x on the
horizontal axis and y on the vertical axis.
The argument "string" designates a pointer to a character
string to be written to the screen.
The arguments "foreground" and "background" are integers
denoting text foreground and background colors as defined
in the header "gr.h".
****************************************************************/
gr_text( screen, x, y, string, foreground, background )
int screen;
int x, y;
int foreground, background;
char *string;
/****************************************************************
gr_strlen()
This function returns the length in pixels on the horizontal
(x) axis of a specified character string.
The argument "string" designates a pointer to a character
string whose horizontal size is to be calculated.
****************************************************************/
unsigned int
gr_strlen( string )
char *string;
/****************************************************************
gr_rectangle()
This function draws and possibly fills in (or blanks) a
rectangular area of the screen.
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
The arguments x1, y1, x2, and y2 specify two pixel locations
on the screen in gr coordinates (see above on the coordinate
system) denoting the bottom left corner (x1, y1) and top right
corner (x2, y2) of the rectangle (x1 and x2 on the horizontal
axis, and y1 and y2 on the vertical axis).
The argument "color" is an integer denoting a color defined
in the header "gr.h".
The argument "style" is an integer denoting a fill style
defined in "gr.h" (HOLLOW, SOLID, GRID, or HATCH -- HOLLOW
means that only a perimeter is drawn; SOLID means that the
area is completely filled with the color, and GRID and HATCH
represent varying degrees of partial fill, with GRID the finer
and HATCH the rougher).
****************************************************************/
gr_rectangle( screen, x1, y1, x2, y2, color, style )
int screen;
int x1, y1, x2, y2;
int color, style;
/****************************************************************
gr_circle()
This function draws and possibly fills in (or blanks) a
circular area of the screen.
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
The arguments x and y specify a pixel location on the screen
in gr coordinates (see above on the coordinate system) where
the center of the circle is to be located, x on the horizontal
axis and y on the vertical axis.
The argument "radius" is an integer denoting the radius of the
circle on the y (vertical) axis. Implementers should note that
the x (horizontal) axis will have to be scaled.
The argument "color" is an integer denoting a color defined
in the header "gr.h".
The argument "style" is an integer denoting a fill style
defined in "gr.h" (HOLLOW, SOLID, GRID, or HATCH -- HOLLOW
means that only a perimeter is drawn; SOLID means that the
area is completely filled with the color, and GRID and HATCH
represent varying degrees of partial fill, with GRID the finer
and HATCH the rougher).
****************************************************************/
gr_circle( screen, x, y, radius, color, style )
int screen;
int x, y, radius;
int color, style;
/****************************************************************
gr_clip()
If clipping is implemented (gr_clipping == TRUE), this
function turns on or off clipping for a specified area
of the screen.
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
The argument "mode" is a boolean integer which tells whether
clipping is to be turned on (TRUE) or off (FALSE).
The arguments x1, y1, x2, and y2 specify two pixel locations
on the screen in gr coordinates (see above on the coordinate
system) denoting the bottom left corner (x1, y1) and top right
corner (x2, y2) of the clipping rectangle (x1 and x2 on the
horizontal axis, and y1 and y2 on the vertical axis).
****************************************************************/
gr_clip( screen, mode, x1, y1, x2, y2 )
int screen;
int mode;
int x1, y1, x2, y2;
/****************************************************************
gr_font()
This function sets a font for future calls to gr_text().
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
The argument "type" is an integer value (not currently
implemented in applications by Bywater Software) which would
denote a font type (these are defined in "gr.h" as F_DEFAULT,
F_ROMAN, F_ITALIC, and F_GOTHIC). Don't worry about it.
The argument "rq_height" is an integer value denoting the
requested height of the new font in pixels. The function should
set the closest available height and then denote the size of
the new font in the fysize variable in the gr_display structure.
****************************************************************/
gr_font( screen, type, rq_height )
int screen;
int type, rq_height;
/****************************************************************
gr_blit()
This function "blits" (copies) a rectangular area of the screen
from GR_PRIMARY to GR_HIDDEN or vice versa (if blitting is
implemented, i.e., gr_blitting == TRUE).
The arguments "src" and "dst" are integers denoting either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN). Obviously, one should be set to GR_PRIMARY and
one to GR_HIDDEN. "src" denotes the source of the blit, and
"dst" the destination.
The arguments x1, y1, x2, and y2 specify two pixel locations
on the screen in gr coordinates (see above on the coordinate
system) denoting the bottom left corner (x1, y1) and top right
corner (x2, y2) of the area to be blitted (x1 and x2 on the
horizontal axis, and y1 and y2 on the vertical axis).
****************************************************************/
gr_blit( src, dst, x1, y1, x2, y2 )
int src, dst;
int x1, y1, x2, y2;
/****************************************************************
gr_imsave()
This function either saves a rectangluar area of the screen to
a memory buffer (mode == TRUE), or restores a rectangular screen
area from the buffer (mode == FALSE). It should free existing memory
when mode == FALSE (thus, the area cannot be restored more than once).
The argument "screen" is an integer denoted either the
visible screen (defined as GR_PRIMARY) or a hidden buffer
to which graphics output can be written (defined as
GR_HIDDEN).
The arguments x1, y1, x2, and y2 specify two pixel locations
on the screen in gr coordinates (see above on the coordinate
system) denoting the bottom left corner (x1, y1) and top right
corner (x2, y2) of the rectangular area to be saved (x1 and x2
on the horizontal axis, and y1 and y2 on the vertical axis).
The argument "image" is a pointer to an integer that will denote
the specific image stored (mode = FALSE) or that will be set to a
new unique number for the image (mode = TRUE).
****************************************************************/
gr_imsave( screen, mode, x1, y1, x2, y2, image )
int screen;
int mode, x1, y1, x2, y2;
int *image;
/****************************************************************
gr_imfree()
This function frees emory allocated by a call to gr_imsave().
****************************************************************/
gr_imfree( image )
int image;
/****************************************************************
gr_mouse()
This function either tells if a mouse button has been pushed
(mode == SAMPLE or STATUS) or waits for a button to be pushed
(mode == WAIT).
The arguments x and y are integer pointers to be filled with a
screen location in gr coordinates (see above on the coordinate
system) where the mouse is currently located, x on the horizontal
axis and y on the vertical axis.
The argument "buttons" is an integer pointer which some great
day will be used to specify which of the mouse buttons has been
pushed but it hasn't been used yet in any Bywater applications
so don't worry about it.
****************************************************************/
gr_mouse( mode, x, y, buttons )
int mode;
int *x, *y;
int *buttons;
REFERENCE FOR KB (KEYBOARD) SYSTEM:
----------------------------------
#define KB_ALT 0x500
#define KB_UP 0x201
#define KB_DOWN 0x202
#define KB_LEFT 0x203
#define KB_RIGHT 0x204
#define KB_P_UP 0x207
#define KB_P_DOWN 0x208
#define KB_HOME 0x209
#define KB_END 0x20a
#define KB_INSERT 0x211
#define KB_DELETE 0x212
#define KB_FK0 0x220
#define KB_FK1 0x221
#define KB_FK2 0x222
#define KB_FK3 0x223
#define KB_FK4 0x224
#define KB_FK5 0x225
#define KB_FK6 0x226
#define KB_FK7 0x227
#define KB_FK8 0x228
#define KB_FK9 0x229
/*************************************************************************
FUNCTION: kb_init()
DESCRIPTION: This function should perform any initialization
necessary for the keyboard system.
INPUT: none.
RETURNS: none.
**************************************************************************/
kb_init()
/*************************************************************************
FUNCTION: kb_deinit()
DESCRIPTION: This function should perform any necessary
deinitialization, that is, return the keyboard
to its default state when a Simple Software
program is to be exited.
INPUT: none.
RETURNS: none.
**************************************************************************/
kb_deinit()
/*************************************************************************
FUNCTION: kb_rxstat()
DESCRIPTION: This function determines whether a character is
ready from the console. The function is used
especially in telecommunications programs,
where it is necessary to poll the keyboard
without locking up the program waiting for a
response.
INPUT: none.
RETURNS: The function returns 0 if no character is
available and 1 if a character is available.
**************************************************************************/
kb_rxstat()
/*************************************************************************
FUNCTION: kb_rx()
DESCRIPTION: This function returns a single character from
the keyboard. If a character is not available
it waits. The function should be able to
recognize any special keys, and return the
appropriate Simple Software KB conventions
designated for them.
INPUT: none.
RETURNS: The function returns the ASCII code for the
key pressed, or the Simple Software KB convention
(see kb.h) for a function or other special key.
**************************************************************************/
kb_rx()
REFERENCE FOR DR (DIRECTORY) SYSTEM:
-----------------------------------
struct dir_ent
{
char filename[ MAX_PATHLENGTH ];
char pathname[ MAX_PATHLENGTH ];
int type;
long size;
};
extern int dr_fs;
extern char dr_all[ MAX_PATHLENGTH ];
/*************************************************************************
dr_first()
This function returns the first instance of a file matching an
ambiguous file specifier (TRUE) or FALSE if no matches are found.
The argument "findb" is a pointer to a character string which
is the ambiguous file specifier.
The argument "retb" is a pointer to a character buffer where
the returned value (if TRUE) will be written.
**************************************************************************/
dr_first( findb, retb )
char findb[];
struct dir_ent *retb;
/*************************************************************************
dr_next()
This function returns the next instance of a file matching the
ambiguous file specifier previously supplied to dr_first(TRUE),
or FALSE if no further matches are found.
The argument "retb" is a pointer to a character buffer where
the returned value (if TRUE) will be written.
**************************************************************************/
dr_next( retb )
struct dir_ent *retb;
REFERENCE FOR TW (TEXT WINDOW) SYSTEM:
-------------------------------------
struct tw_struct
{
int x1; /* left side in graphics coords */
int y1; /* bottom in graphics coords */
int x2; /* right side in graphics coords */
int y2; /* top in graphics coords */
int fxsize; /* font size graphics coords */
int fysize; /* font size graphics coords */
int lines; /* number of text lines */
int columns; /* number of text columns */
}
/*****************************************************************
tw_init()
This function opens a text window and performs necessary
initializations.
rq_x1, rq_y1, rq_x2, and rq_y2 specify coordinates for
the requested text window.
rq_lines and rq_cols specify the requested number of text
lines and columns requested.
min_x1, min_y1, min_x2, and min_y2 specify rectangluar
bounds that may not be transgressed in assigning the
new text window (i.e., should not go farther left than
x1, should not go farther down than y1, should not go
farther right than x2, and should not go farther up than
y2).
The function returns NULL if unsuccessful, or a pointer
to a tw_struct structure, which will include the
coordinates actually assigned to the new window.
*****************************************************************/
struct tw_struct *
tw_init( rq_x1, rq_y2, rq_lines, rq_cols, min_x1, min_y1, max_x2, max_y2 )
int rq_x1; /* requested x1 (left, graphics) position */
int rq_y2; /* requested y2 (top, graphics) position */
int rq_lines; /* requested text lines */
int rq_cols; /* requested text columns */
int min_x1; /* leftmost allowable position */
int min_y1; /* bottommost allowable position */
int max_x2; /* rightmost allowable position */
int max_y2; /* topmost allowable position */
/*****************************************************************
tw_deinit()
This function performs any necessary deinitialization
of a text window.
*****************************************************************/
tw_deinit( tw )
struct tw_struct *tw;
/*****************************************************************
tw_outc()
This function outputs a single character (c) to the
currently selected text window at the current position
and in the current color.
*****************************************************************/
tw_outc( c )
int c;
/*****************************************************************
tw_outs()
This function outputs a line of text to the currently
selected text window at the position specified by
line and column, with the color specified.
*****************************************************************/
tw_outs( s, line, column, color )
char *s;
int line, column, color;
/*****************************************************************
tw_adr()
This function addresses the cursor in the currently
selected text window to a specified line and column.
*****************************************************************/
tw_adr( line, column )
int line, column;
/*****************************************************************
tw_cursor()
This function turns on or off the cursor in the
currently selected text window (1 = ON, 0 = OFF).
*****************************************************************/
tw_cursor( action )
int action;
/*****************************************************************
tw_cleol()
This function clears the line of text in the currently
selected text window from the cursor position to the
end of the line.
*****************************************************************/
tw_cleol( line, column )
int line, column;
REFERENCE FOR UI (USER INTERFACE) SYSTEM:
----------------------------------------
struct uiwindow
{
int x1; /* left of whole area */
int y1; /* bottom of whole area */
int x2; /* right of whole area */
int y2; /* top of whole area */
int t_flag; /* is there a title ? */
int t_bcolor; /* title background color */
int t_tcolor; /* title text color */
int tbar_x1; /* left of title bar */
int tbar_y1; /* bottom of title bar */
int tbar_x2; /* right of title bar */
int tbar_y2; /* top of title bar */
int ti_x1; /* left side of title area */
int ti_y1; /* bottom of title area */
int ti_x2; /* right side of title area */
int ti_y2; /* top of title area */
int s_flag; /* is there a shadow? */
int s_color; /* shadow color */
int b_flag; /* is there a border ? */
int b_color; /* border color */
int m_color; /* main area color */
int m_style; /* main area fill style */
int buttons; /* buttons selected */
int bt_x1; /* left side of close button */
int bt_y1; /* bottom of close button */
int bt_x2; /* right side of close button */
int bt_y2; /* top of close button */
int re_x1; /* left side of resize button */
int re_y1; /* bottom of resize button */
int re_x2; /* right side of resize button */
int re_y2; /* top of resize button */
int mv_x1; /* left side of move button */
int mv_y1; /* bottom of move button */
int mv_x2; /* right side of move button */
int mv_y2; /* top of move button */
int u_x1; /* left of usable space */
int u_y1; /* bottom of usable space */
int u_x2; /* right of usable space */
int u_y2; /* top of usable space */
};
struct menu_box
{
struct uiwindow *window; /* uiwindow for menu/icon box */
int type; /* type of menu */
char **d_titles; /* array of titles */
struct dir_ent **d_entries; /* array of directory entries */
int max_entries; /* max items in each array */
int is_drawn; /* is menu/icon box drawn? */
int save_fysize; /* save font y size */
int save_font; /* save font type */
int xsize; /* x size of single icon space */
int ysize; /* y size of single icon space */
int x_items; /* number of icons on x axis */
int y_items; /* number of icons on y axis */
int x_logical; /* logical items on x axis */
int y_logical; /* logical items on y axis */
int x_pos; /* current position, x axis */
int y_pos; /* current position, y axis */
int current; /* currently selected item */
int x_start; /* starting position for x axis */
int y_start; /* starting position for y axis */
int fore; /* foreground color */
int back; /* background color */
int high; /* highlight color */
int number; /* total number of icons/menu items */
int i_x1; /* icon area, left */
int i_y1; /* icon area, bottom */
int i_x2; /* icon area, right */
int i_y2; /* icon area, top */
int vs_x1; /* vertical slide, left */
int vs_y1; /* vertical slide, bottom */
int vs_x2; /* vertical slide, right */
int vs_y2; /* vertical slide, top */
int ve_y1; /* vertical elevator, bottom */
int ve_y2; /* vertical elevator, top */
int hs_x1; /* horizontal slide, left */
int hs_y1; /* horizontal slide, bottom */
int hs_x2; /* horizontal slide, right */
int hs_y2; /* horizontal slide, top */
int he_x1; /* horizontal elevator, left */
int he_x2; /* horizontal elevator, right */
int vel_x1; /* vertical elevator left */
int vel_y1; /* vertical elevator bottom */
int vel_x2; /* vertical elevator right */
int vel_y2; /* vertical elevator top */
int vel_inc; /* vertical elevator increment */
int hel_x1; /* horizontal elevator left */
int hel_y1; /* horizontal elevator bottom */
int hel_x2; /* horizontal elevator right */
int hel_y2; /* horizontal elevator top */
int hel_inc; /* horizontal elevator increment */
};
/*****************************************************************
*****************************************************************/
struct pbm_struct
{
int xsize;
int ysize;
char *image;
};
/*****************************************************************
*****************************************************************/
struct ui_twstruct
{
struct tw_struct *tw;
struct uiwindow *uiw;
};
/*****************************************************************
*****************************************************************/
ui_init()
/*****************************************************************
*****************************************************************/
ui_setscreen( screen )
int screen;
/*****************************************************************
*****************************************************************/
ui_push()
/*****************************************************************
*****************************************************************/
ui_pop()
/*****************************************************************
*****************************************************************/
struct uiwindow *
ui_window( x1, y1, x2, y2, t_flag, t_bcolor, t_tcolor, t_text,
b_flag, b_color,
s_flag, s_color, m_color, m_style, buttons )
int x1, y1, x2, y2; /* coordinates of whole area */
int t_flag; /* title flag */
int t_bcolor, t_tcolor; /* title background & text colors */
char *t_text; /* text of title */
int b_flag, b_color; /* border flag, color */
int s_flag, s_color; /* shadow flag, color */
int m_color, m_style; /* color & style for main box */
int buttons; /* buttons */
/*****************************************************************
*****************************************************************/
ui_rewindow( window, newtitle )
struct uiwindow *window;
char *newtitle;
/*****************************************************************
*****************************************************************/
ui_fbox( x1, y1, x2, y2, color, style )
int x1, y1, x2, y2, color, style;
/*****************************************************************
*****************************************************************/
ui_hbox( x1, y1, x2, y2, color )
int x1, y1, x2, y2, color;
/*****************************************************************
*****************************************************************/
ui_wtitle( window, buffer )
struct uiwindow *window;
char *buffer;
/*****************************************************************
*****************************************************************/
ui_str( x1, y1, x2, background, foreground, buffer )
int x1, y1, x2, background, foreground;
char *buffer;
/*****************************************************************
*****************************************************************/
ui_text( x1, y1, x2, y2, maxlines, background, foreground, main_buffer )
int x1, y1, x2, y2; /* Coordinates of box */
int maxlines; /* Maximum lines to be used */
int background; /* Background color */
int foreground; /* Foreground color */
char *main_buffer; /* Text buffer */
/*****************************************************************
*****************************************************************/
ui_wait()
/*****************************************************************
*****************************************************************/
ui_getch()
/*****************************************************************
*****************************************************************/
ui_gets( window, x, y, maxlength, buffer, display, foreground, background )
struct gr_window *window;
int x, y, maxlength, display, foreground, background;
char *buffer;
/*****************************************************************
*****************************************************************/
ui_dial( x1, y1, x2, y2, background, foreground, marker_color, shadow,
title, text, prompt, buffer, i_window )
int x1, y1, x2, y2, background, foreground, shadow, marker_color;
char *title, *text, *prompt, *buffer;
struct uiwindow **i_window;
/*****************************************************************
*****************************************************************/
ui_yn( x1, y1, x2, y2, background, foreground, marker_color, shadow,
text, mes0, mes1, i_window )
int x1, y1, x2, y2, background, foreground, shadow, marker_color;
char *text, *mes0, *mes1;
struct uiwindow **i_window;
/*****************************************************************
*****************************************************************/
ui_alarm( x1, y1, x2, y2, background, foreground, marker_color, shadow,
text, prompt, i_window )
int x1, y1, x2, y2, background, foreground, shadow, marker_color;
char *text, *prompt;
struct uiwindow **i_window;
/*****************************************************************
*****************************************************************/
ui_disp( x1, y1, x2, y2, background, foreground, shadow, title, text,
i_window )
int x1, y1, x2, y2, background, foreground, shadow;
char *title, *text;
struct uiwindow **i_window;
/****************************************************************
ui_ftext() File selection -- text based
****************************************************************/
ui_ftext( x1, y1, x2, y2, specifier, title, m_box,
d_titles, d_entries, max_entries,
background, foreground, highlight )
int x1, y1, x2, y2, background, foreground, highlight, max_entries;
struct menu_box *m_box;
char *specifier, *title;
char **d_titles;
struct dir_ent **d_entries;
/****************************************************************
ui_list() Scrolling list (menu)
****************************************************************/
ui_list( type, x1, y1, x2, y2, title, number, titles,
foreground, background, highlight, m_box )
int type, x1, y1, x2, y2, foreground, background,
highlight, number;
char *title;
char **titles;
struct menu_box *m_box;
/****************************************************************
uil_draw() - draw a list box
****************************************************************/
uil_draw( type, x1, y1, x2, y2, title, number, titles,
foreground, background, highlight, m_box )
int type, x1, y1, x2, y2, foreground, background,
highlight, number;
char *title;
char **titles;
struct menu_box *m_box;
/****************************************************************
uil_activate() Activate a list box
****************************************************************/
uil_activate( m_box, type, item )
struct menu_box *m_box;
int type, item;
/****************************************************************
uil_deactivate() Deactivate a list menu box
****************************************************************/
uil_deactivate( m_box, type )
struct menu_box *m_box;
int type;
/****************************************************************
uil_event() Query if an event affects a list box
****************************************************************/
uil_event( m_box, key, mo_xsrc, mo_ysrc, mo_xdest, mo_ydest, type, item )
struct menu_box *m_box;
int key, mo_xsrc, mo_ysrc, mo_xdest, mo_ydest, type;
int *item;
/****************************************************************
ui_event() Query if keyboard or mouse actions affect
a list or icon menu box
****************************************************************/
ui_event( m_box, key, mo_xsrc, mo_ysrc, mo_xdest, mo_ydest,
how_far, x_sel, y_sel )
struct menu_box *m_box;
int key, mo_xsrc, mo_ysrc, mo_xdest, mo_ydest;
int *how_far, *x_sel, *y_sel;
/****************************************************************
uil_bounds() See if x and y are within bounds of x1, y1, x2, y2
****************************************************************/
uil_bounds( x, y, x1, y1, x2, y2 )
int x, y, x1, y1, x2, y2;
/****************************************************************
ui_ficon() File selection -- icon-based
****************************************************************/
ui_ficon( x1, y1, x2, y2, specifier, title, m_box,
d_entries, max_entries,
background, foreground, highlight )
int x1, y1, x2, y2, background, foreground, highlight, max_entries;
struct menu_box *m_box;
char *specifier, *title;
struct dir_ent **d_entries;
/****************************************************************
uii_draw() - draw file selection icon area
****************************************************************/
uii_draw( x1, y1, x2, y2, specifier, title, m_box,
d_entries, max_entries,
background, foreground, highlight )
int x1, y1, x2, y2, background, foreground, highlight, max_entries;
struct menu_box *m_box;
char *specifier, *title;
struct dir_ent **d_entries;
/****************************************************************
uii_activate() Activate an icon menu box
****************************************************************/
uii_activate( m_box, item )
struct menu_box *m_box;
int item;
/****************************************************************
uii_deactivate() Deactivate an icon menu box
****************************************************************/
uii_deactivate( m_box )
struct menu_box *m_box;
/****************************************************************
uii_event() Query if keyboard or mouse actions affect an icon
menu box
****************************************************************/
uii_event( m_box, key, mo_xsrc, mo_ysrc, mo_xdest, mo_ydest, item )
struct menu_box *m_box;
int key, mo_xsrc, mo_ysrc, mo_xdest, mo_ydest;
int *item;
/****************************************************************
uii_source() Query if keyboard or mouse actions indicate a
source within a menu box
****************************************************************/
uii_source( m_box, key, mo_xsrc, mo_ysrc, mo_xdest, mo_ydest, item )
struct menu_box *m_box;
int key, mo_xsrc, mo_ysrc, mo_xdest, mo_ydest;
int *item;
/*****************************************************************
*****************************************************************/
ui_pbmread( file, pmstruct, foreground, background )
char *file;
struct pbm_struct *pmstruct;
int foreground, background;
/*****************************************************************
*****************************************************************/
ui_pbmshow( screen, x, y, pmstruct )
int screen;
int x, y;
struct pbm_struct *pmstruct;
/*****************************************************************
*****************************************************************/
ui_pbmcenter( screen, x1, y1, x2, y2, pmstruct )
int screen;
int x1, y1, x2, y2;
struct pbm_struct *pmstruct;
/*****************************************************************
*****************************************************************/
ui_pbmtile( screen, x1, y1, x2, y2, pmstruct )
int screen;
int x1, y1, x2, y2;
struct pbm_struct *pmstruct;
/*****************************************************************
*****************************************************************/
ui_clinit( x, y, fore, back )
int x, y, fore, back;
/*****************************************************************
*****************************************************************/
ui_clock()
/*****************************************************************
*****************************************************************/
ui_clforce()
/*****************************************************************
*****************************************************************/
ui_rband( mode, x1, y1, x2, y2 )
int mode;
int *x1, *y1, *x2, *y2;
/*****************************************************************
*****************************************************************/
struct ui_twstruct *
ui_twinit( title, rq_x1, rq_y2, rq_lines, rq_cols,
min_x1, min_y1, max_x2, max_y2 )
char *title; /* ttle for window */
int rq_x1; /* requested x1 (left, graphics) position */
int rq_y2; /* requested y2 (top, graphics) position */
int rq_lines; /* requested text lines */
int rq_cols; /* requested text columns */
int min_x1; /* leftmost allowable position */
int min_y1; /* bottommost allowable position */
int max_x2; /* rightmost allowable position */
int max_y2; /* topmost allowable position */
/*****************************************************************
*****************************************************************/
ui_twdeinit()